Skip to content

Conversation

@zaneb
Copy link
Member

@zaneb zaneb commented Aug 18, 2022

Numerous places assume that there will be at least one NMStateConfig:

Since these are not easily discoverable by users, temporarily reinstate
the requirement that at least one NMState configuration be provided
(even if the RendezvousIP is specified). This will provide users with an
upfront error rather than a difficult-to-debug mystery.

@openshift-ci openshift-ci bot requested review from andfasano and rwsu August 18, 2022 04:09
@zaneb zaneb force-pushed the nmstate-required branch from 5a86e0e to 1a691d7 Compare August 18, 2022 13:36
zaneb added 2 commits August 18, 2022 09:41
We want to get the first static IP address, not the IP address of the
first interface.
…fied

Numerous places assume that there will be at least one NMStateConfig:

* https://bugzilla.redhat.com/show_bug.cgi?id=2116489
* https://bugzilla.redhat.com/show_bug.cgi?id=2115770
* https://bugzilla.redhat.com/show_bug.cgi?id=2115798
* https://bugzilla.redhat.com/show_bug.cgi?id=2115803
* https://bugzilla.redhat.com/show_bug.cgi?id=2117302

Since these are not easily discoverable by users, temporarily reinstate
the requirement that at least one NMState configuration be provided
(even if the RendezvousIP is specified). This will provide users with an
upfront error rather than a difficult-to-debug mystery.
@zaneb zaneb force-pushed the nmstate-required branch from 1a691d7 to a17dfe3 Compare August 18, 2022 13:42
},
}

if len(agentManifests.NMStateConfigs) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend to perform this check in the related asset, here:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's legal to e.g. use an empty agent-config to create the cluster-manifests and only fill in the NMStateConfigs after. So we don't want to validate too early, only when you go to create the image and you don't have any NMStateConfigs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the message be more clear that either provide at least one nmstateconfig in cluster-manifests/nmstateconfig.yaml or if providing agent-config.yaml provide at least one nmstateconfig in the networkConfig?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, but it's just the NMStateConfig asset that loads the content of the cluster-manifests/nmstateconfig.yaml file if present on the disk. The AgentManifests it's just a collector, and it's resolved as a dependency in stack by the Ignition one, so not sure if I'm missing something but the validation location doesn't seem the right one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2022-08-18 16-54-32

Copy link
Contributor

@andfasano andfasano Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the create cluster-manifests it's in good shape now, but if you run it with just the install-config.yaml (and without an agent-config.yaml, so that it will get generated), currently the nil check will already fail

Copy link
Contributor

@andfasano andfasano Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the validation is placed in nmstateconfig, then "create cluster-manifests" will immediately fail, thus forcing you to provide the nmstateconfig in the agent-config.

So wouldn't be better in general to provide an agent-config template so that the NMStateConfig will not fail, rather than moving the check into another asset?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So wouldn't be better in general

This check is going away again in a couple of weeks, as soon as we have fixed all of the linked bugs. Let's not get too general.

to provide an agent-config template so that the NMStateConfig will not fail, rather than moving the check into another asset?

That wouldn't solve the case where you intentionally create an agent-config with no NMState data, with the intent to customise the manifests to add NMState data after create cluster-manifests.
The only way to catch that case is to make sure the validation doesn't run until you do create image, and the only way to do that is to put it in an asset that is only required by the image target.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, especially considering if that check will go away soon. In general my concerns are about not making an asset self-sufficient, which could indicate a potential problem somewhere else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, the aforementioned scenario was still broken for me, I will re-test it with the latest changes as a double-check

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

@zaneb: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@rwsu rwsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

},
}

if len(agentManifests.NMStateConfigs) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what Zane has currently implemented allows a user to first run "create cluster-manifests", edit the nmstateconfig to make any changes, and then run "create image".

If the validation is placed in nmstateconfig, then "create cluster-manifests" will immediately fail, thus forcing you to provide the nmstateconfig in the agent-config.

},
}

if len(agentManifests.NMStateConfigs) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, if none of them (agent-config and nmstateconfig) are provided I'd expect that this validation will fail

From my testing, the validation in ignition works.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2022
@bfournie
Copy link
Contributor

Tested with dev-scripts
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bfournie

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2022
@openshift-merge-robot openshift-merge-robot merged commit 7880e5d into openshift:agent-installer Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants